{template 'header'}
<link type="text/css" rel="stylesheet" href="../addons/jufeng_wcy/images/common.css">
<style>
.table{font-size:12px;}
.table td{padding:5px 0;}
.table .title{border-top:0; font-weight:600; color:#51a351;}
.table .price{}
.table .price .total{font-size:14px; font-weight:bold; display:inline-block; width:100px;}
.table .price .btn{margin-top:5px;}
.table .price .payover{font-size:14px; font-weight:bold;}
</style>

<div class="order-main">
	<div class="order-hd">
    <span>我的订单</span>
	</div>
			{loop $list $item}
            	<div class="order-detail">

            		<div class="order-detail-list">
			<table class="table">
            <tr>
					<td class="title suoshudianjia" colspan="3">
						<span class="pull-left">所属店家：<i>{$item['pcate3'][0]['name']}</i></span>
                        <span class="pull-right"><b>总计：{$item['price']}元</b></span>
					</td>
				</tr>
                 <tr>
					<td class="title dd" colspan="3">
						<span class="pull-left">联系电话：</span>
                        <span class="pull-right"><b>{$item['mobile']}</b></span>
					</td>
				</tr>
                 <tr>
					<td class="title dd" colspan="3">
						<span class="pull-left">送餐时间：</span>
                        <span class="pull-right"><b>{$item['time']}</b></span>
					</td>
				</tr>
                 <tr>
					<td class="title dd" colspan="3">
						<span class="pull-left">送餐地址：</span>
                        <span class="pull-right"><b>{$item['address']}</b></span>
					</td>
				</tr>
                <tr>
					<td class="title dd" colspan="3">
						<span class="pull-left">支付方式：</span>
                        <span class="pull-right"><b>{if $item['paytype'] == 1}在线支付{else}餐到付款{/if}</b></span>
					</td>
				</tr>
                {if $item['other']}
                 <tr>
					<td class="title dd" colspan="3">
						<span class="pull-left">订单备注：</span>
                        <span class="pull-right"><b>{$item['other']}</b></span>
					</td>
				</tr>
                {/if}
				<tr>
					<td class="title" colspan="3">
						<span class="pull-right">{php echo date('Y-m-d H:i', $item['createtime'])}</span>
						<span class="pull-left">★订单号：{$item['ordersn']}</span>
					</td>
				</tr>
				{loop $item['foods'] $foods}
				<tr>
					<td style="width:40%;">{$foods['title']}</td>
					<td style="width:60%; text-align:right;">数量：{$item['total'][$foods['id']]['total']}，单价：{if $foods['preprice']}{$foods['preprice']}{else}{$foods['oriprice']}{/if}元 / {$foods['unit']}</td>
				</tr>
				{/loop}
				<tr>
					<td class="price" colspan="3">
						<div>
								{if $item['status'] == -2}
                                 <span class="text-success payover">已删除</span>
                                <span class="text-success payover btn btn-danger">
                                 <a href="{php echo $this->createMobileUrl('orderctr', array('id' => $item['id'], 'op' => 'delete','pcate'=>$_GPC['pcate'],'ccate'=>$_GPC['ccate']))}" onclick="return confirm('确认彻底删除订单吗？');return false;">彻底删除</a>
                                 </span>
                                 {elseif $item['status'] == -1}
                                 <span class="text-success payover">已取消</span>
                                <span class="text-success payover btn btn-danger">
                                 <a href="{php echo $this->createMobileUrl('orderctr', array('id' => $item['id'], 'op' => 'delete','pcate'=>$_GPC['pcate'],'ccate'=>$_GPC['ccate']))}" onclick="return confirm('确认彻底删除订单吗？');return false;">彻底删除</a>
                                 </span>
                                  {elseif $item['status'] == 0}
                                 <span class="text-success payover">已完成</span>
                                <span class="text-success payover btn btn-danger">
                                 <a href="{php echo $this->createMobileUrl('orderctr', array('id' => $item['id'], 'op' => 'delete','pcate'=>$_GPC['pcate'],'ccate'=>$_GPC['ccate']))}" onclick="return confirm('确认彻底删除订单吗？');return false;">彻底删除</a>
                                 </span>
                                 {elseif $item['status'] == 1}
                                 <span class="text-success payover">等待支付</span>
                                <span class="text-success payover btn btn-danger">
                                 <a href="{php echo $this->createMobileUrl('orderctr', array('id' => $item['id'], 'op' => 'quxiao','pcate'=>$_GPC['pcate'],'ccate'=>$_GPC['ccate']))}" onclick="return confirm('确认取消此订单吗？');return false;">取消</a>
                                 </span>
                                 <span class="text-success payover btn btn-danger">
                                 <a href="{php echo $this->createMobileUrl('orderctr', array('id' => $item['id'], 'op' => 'wancheng','pcate'=>$_GPC['pcate'],'ccate'=>$_GPC['ccate']))}" onclick="return confirm('确认转为已完成吗？');return false;">转为已完成</a>
                                 </span>
                                 <span class="text-success payover btn btn-danger">
                                 <a href="{php echo $this->createMobileUrl('orderctr', array('id' => $item['id'], 'op' => 'yixia','pcate'=>$_GPC['pcate'],'ccate'=>$_GPC['ccate']))}" onclick="return confirm('确认转为已下单吗？');return false;">转为已下单</a>
                                 </span>
                                 <span class="text-success payover btn btn-danger">
                                 <a href="{php echo $this->createMobileUrl('orderctr', array('id' => $item['id'], 'op' => 'jieshou','pcate'=>$_GPC['pcate'],'ccate'=>$_GPC['ccate']))}" onclick="return confirm('确认接受此订单吗？');return false;">接受</a>
                                 </span>
                                 {elseif $item['status'] == 2}
                                 <span class="text-success payover">已下单</span>
                                <span class="text-success payover btn btn-danger">
                                 <a href="{php echo $this->createMobileUrl('orderctr', array('id' => $item['id'], 'op' => 'quxiao','pcate'=>$_GPC['pcate'],'ccate'=>$_GPC['ccate']))}" onclick="return confirm('确认取消此订单吗？');return false;">取消</a>
                                 </span>
                                 <span class="text-success payover btn btn-danger">
                                 <a href="{php echo $this->createMobileUrl('orderctr', array('id' => $item['id'], 'op' => 'wancheng','pcate'=>$_GPC['pcate'],'ccate'=>$_GPC['ccate']))}" onclick="return confirm('确认转为已完成吗？');return false;">转为已完成</a>
                                 </span>
                                 <span class="text-success payover btn btn-danger">
                                 <a href="{php echo $this->createMobileUrl('orderctr', array('id' => $item['id'], 'op' => 'jieshou','pcate'=>$_GPC['pcate'],'ccate'=>$_GPC['ccate']))}" onclick="return confirm('确认接受此订单吗？');return false;">接受</a>
                                 </span>
                                 {elseif $item['status'] == 3}
                                 <span class="text-success payover">已确认</span>
                                <span class="text-success payover btn btn-danger">
                                 <a href="{php echo $this->createMobileUrl('orderctr', array('id' => $item['id'], 'op' => 'quxiao','pcate'=>$_GPC['pcate'],'ccate'=>$_GPC['ccate']))}" onclick="return confirm('确认取消此订单吗？');return false;">取消</a>
                                 </span>
                                 <span class="text-success payover btn btn-danger">
                                 <a href="{php echo $this->createMobileUrl('orderctr', array('id' => $item['id'], 'op' => 'wancheng','pcate'=>$_GPC['pcate'],'ccate'=>$_GPC['ccate']))}" onclick="return confirm('确认转为已完成吗？');return false;">转为已完成</a>
                                 </span>
                           {/if}
						</div>
					</td>
				</tr>
			</table>
            </div>
            
            	</div>

			{/loop}
		
</div>
<div class="navbar1 navbar2 btn-group btn-group-justified">
      <div class="btn-group btn-group-lg">
      <a href="{php echo $this->createMobileUrl('listctr', array('pcate'=>$_GPC['pcate'],'ccate'=>$_GPC['ccate']))}" class="btn btn-default" role="button"><i class="glyphicon glyphicon-chevron-left"></i>&nbsp;店铺控制</a>
      </div>
      <div class="btn-group btn-group-lg">
      <a href="{php echo url('mc');}" class="btn btn-default" role="button"><i class="glyphicon glyphicon-user"></i>&nbsp;会员中心</a>
      </div>
    </div>
<script>
$(function() {
	$('.order-detail-list li:last').css("border-bottom", 0);
});
</script>
{template 'footer'}